.\"
.\" Copyright (C) 1994-2021 Altair Engineering, Inc.
.\" For more information, contact Altair at www.altair.com.
.\"
.\" This file is part of both the OpenPBS software ("OpenPBS")
.\" and the PBS Professional ("PBS Pro") software.
.\"
.\" Open Source License Information:
.\"
.\" OpenPBS is free software. You can redistribute it and/or modify it under
.\" the terms of the GNU Affero General Public License as published by the
.\" Free Software Foundation, either version 3 of the License, or (at your
.\" option) any later version.
.\"
.\" OpenPBS is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
.\" License for more details.
.\"
.\" You should have received a copy of the GNU Affero General Public License
.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
.\"
.\" Commercial License Information:
.\"
.\" PBS Pro is commercially licensed software that shares a common core with
.\" the OpenPBS software.  For a copy of the commercial license terms and
.\" conditions, go to: (http://www.pbspro.com/agreement.html) or contact the
.\" Altair Legal Department.
.\"
.\" Altair's dual-license business model allows companies, individuals, and
.\" organizations to create proprietary derivative works of OpenPBS and
.\" distribute them - whether embedded or bundled with other software -
.\" under a commercial license agreement.
.\"
.\" Use of Altair's trademarks, including but not limited to "PBS™",
.\" "OpenPBS®", "PBS Professional®", and "PBS Pro™" and Altair's logos is
.\" subject to Altair's trademark licensing policies.
.\"
.TH pbs_account 8B "18 November 2019" Local "PBS Professional"
.SH NAME
.B pbs_account 
For Windows.  Manage PBS service account
.SH SYNOPSIS
.B pbs_account 
[-a <PBS service account name>] [-c [<password>]] [--ci] 
.RS 12
[--instid <instance ID>] [-o <output path>] 
.br
[-p [<password>]] [--reg <service path>] [-s] 
.br
[--unreg <service path>]
.RE

.SH DESCRIPTION
The
.B pbs_account
command is used to manage the PBS service account. It is used to
create the account, set or validate the account password, add
privileges to the account, and register or unregister the account with
the SCM.

.SH Permissions
This command can be run by administrators only.

.SH Platforms
This command is available on Windows only.

.SH Caveats
Using 
.B pbs_account --unreg
and
.B pbs_account --reg 
stops and restarts MoM, which can kill jobs.

.SH OPTIONS
.IP "-a <account name>" 15
Specifies service account name.

.IP "-c [<password>]" 15  
If specified account does not exist, creates the account with the password.

If specified account exists, validates password against it.

Gives necessary privileges to the specified account: 
.I Create Token Object, Replace Process Level Token, Log on as a Service, 
and 
.I Act as Part of the Operating System

If password is not specified, user is prompted for password.

.IP "--ci" 15
Informational only.  Prints actions taken by pbs_account while
creating PBS service account while operations are performed.

.IP "instid <instance ID>" 15
Specifies the instance ID when registering or unregistering multiple
instances of a service.  Example:
.RS 18
pbs_account --reg "C:\\Program Files (x86)\\PBS Pro_2\\exec\\sbin\\pbs_mom" --instid 2 -a <username> -p <password>
.br
pbs_account --unreg "C:\\Program Files (x86)\\PBS Pro_2\\exec\\sbin\\pbs_mom" --instid 2

.RE

.IP "-o <output path>" 15   
Prints stdout and stderr messages in specified output path.

.IP "-p [<password >]" 15
Updates the PBS service account password. If no password is specified,
the user is prompted for a password.

.IP "--reg <path to service>" 15
Registers the PBS service with the SCM, instructing it to run the services 
under the PBS service account.  
.I path to service
must be in double quotes.  Restarts MoM. 

.IP "-S" 15
Adds necessary privileges to the PBS service account. Grants the
"Create Token Object", "Replace Process Level Token", "Log On as a
Service", and "Act as Part of the Operating System" privileges to PBS
service account.

.IP "--unreg <path to service>" 15
Unregisters the PBS service with the SCM.  
.I path to service
must be in double quotes.  Stops MoM.

.IP "(no options)" 15
Prints name of PBS service account, if it exists.  Exit value is 0.


.SH Examples

To create the PBS service account:
.RS 4
pbs_account -c -s -p <password>
.RE
To change the PBS service account:
.RS 4
pbs_account [--reg <service path>] -a <PBS service account name>
.RE
To register the MoM service:
.RS 4
.nf
pbs_account --reg "\\Program Files\\PBS Pro\\exec\\sbin\\pbs_mom.exe" -p <password>
.fi
.RE

.SH Exit Value

.IP "Zero" 15
Upon success
